Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThemeSelector Update Phase2 #418

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

ThemeSelector Update Phase2 #418

wants to merge 5 commits into from

Conversation

rabbitism
Copy link
Member

@rabbitism rabbitism commented Sep 20, 2024

  1. ThemeSelector now has a new property: ThemeSource.
  2. ThemeToggleButton actually controls ThemeSource if it is not set.
  3. Instead of maintaining a nullable boolean as internal state, ThemeToggleButton now just looking for next Theme available in ThemeSource.
  4. ThemeToggleButton always respect RequestThemeVariant on initialized. if it is set.
  5. Introduce a new Control, ThemeSelector. It behaves like a combobox.

Further fix of #340

demo/Ursa.Demo/App.axaml Outdated Show resolved Hide resolved
{
AvaloniaObject? result = TargetScope;
result ??= this.GetLogicalAncestors().OfType<ThemeVariantScope>().FirstOrDefault();
result ??= TargetScope;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the line duplicated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes its redundant.

@zdpcdt
Copy link
Collaborator

zdpcdt commented Sep 23, 2024

In Controller+ThreeState mode, if the system defaults to Dark theme, the toggle can switch between three states. If the system defaults to Light theme, the toggle can only switch between two states

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants